Triangular function
part 2/7 · 9.8 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Contents
• Scaling
• See also
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Definitions
The most common definition is as a piecewise function:
tri ( x ) = Λ Λ ( x ) = def max ( 1 − − | x | , 0 ) = { 1 − − | x | , | x | < 1 ; 0 otherwise . {\displaystyle {\begin{aligned}\operatorname {tri} (x)=\Lambda (x)\ &{\overset {\underset {\text{def}}{}}{=}}\ \max {\big (}1-|x|,0{\big )}\\&={\begin{cases}1-|x|,&|x|<1;\\0&{\text{otherwise}}.\\\end{cases}}\end{aligned}}}
Equivalently, it may be defined as the convolution of two identical unit rectangular functions:
tri ( x ) = rect ( x ) ∗ ∗ rect ( x ) = ∫ ∫ − − ∞ ∞ ∞ ∞ rect ( x − − τ τ ) ⋅ ⋅ rect ( τ τ ) d τ τ . {\displaystyle {\begin{aligned}\operatorname {tri} (x)&=\operatorname {rect} (x)*\operatorname {rect} (x)\\&=\int _{-\infty }^{\infty }\operatorname {rect} (x-\tau )\cdot \operatorname {rect} (\tau )\,d\tau .\\\end{aligned}}}
The triangular function can also be represented as the product of the rectangular and absolute value functions:
tri ( x ) = rect ( x / 2 ) ( 1 − − | x | ) . {\displaystyle \operatorname {tri} (x)=\operatorname {rect} (x/2){\big (}1-|x|{\big )}.}
Note that some authors instead define the triangle function to have a base of width 1 instead of width 2:
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────